var MagicDeletionObject = Class.create({
  initialize: function(form) {
    form.select('input[type="submit"]').invoke('observe', 'click', this.submitForm.bindAsEventListener(this));
    //form.observe('click', this.submitForm.bindAsEventListener(form));
  },
  
  submitForm: function(deletionEvent) {
    deletionEvent.stop();
    var agree = confirm("Are you sure you wish to delete this event?");
    if (agree){
      deletionEvent.target.up('form').submit();    
    }
    else{
      return false;
    }
  }
})